<template>
	<view class="data">
		<view class="fixed_date"><uni-dateformat :date="timer" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat></view>
		<uni-group title="【店铺入驻】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{shop.applynum.tnum}}</text>
					<text>今日申请</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.applynum.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.applynum.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.applynum.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.applynum.anum}}</text>
					<text>申请总量</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{shop.checknum.tnum}}</text>
					<text>今日入驻</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.checknum.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.checknum.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.checknum.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{shop.checknum.anum}}</text>
					<text>入驻总量</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{shop.group.num}}</text>
					<text>团购店铺</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{shop.nogroup.num}}</text>
					<text>非团购店铺</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【团购上架数量】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{groupGoods.tnum}}</text>
					<text>今日团购</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupGoods.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupGoods.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupGoods.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupGoods.anum}}</text>
					<text>团购总量</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【用户新增】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{member.tnum}}</text>
					<text>今日新增</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{member.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{member.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{member.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{member.anum}}</text>
					<text>用户总量</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【团队数据】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{bonusLevel.tnum}}</text>
					<text>新增团长</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.allnum}}</text>
					<text>身份总量</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.level1}}</text>
					<text>团长</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.level2}}</text>
					<text>合伙人</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.level3}}</text>
					<text>运营公司</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.level4}}</text>
					<text>区县数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{bonusLevel.anum.level5}}</text>
					<text>市级数</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【排队数据】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{lineup.statistics.total}}</text>
					<text>总排队</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.statistics.shop}}</text>
					<text>商城排队</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.statistics.gift}}</text>
					<text>礼包排队</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.statistics.store}}</text>
					<text>门店排队</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{lineup.pending.total}}</text>
					<text>总待发放</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.pending.shop}}</text>
					<text>商城待发</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.pending.gift}}</text>
					<text>礼包待发</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{lineup.pending.store}}</text>
					<text>门店待发</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{lineup.gran.tnum}}</text>
					<text>今日发放</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.gran.ynum}}</text>
					<text>昨日发放</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.gran.tmnum}}</text>
					<text>本月发放</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{lineup.gran.pmnum}}</text>
					<text>上月发放</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【财务数据】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.tnum.money}}</text>
					<text>营业额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.ynum.money}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.tmnum.money}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.pmnum.money}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.anum.money}}</text>
					<text>总支付</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.tnum.total}}</text>
					<text>今日笔数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.ynum.total}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.tmnum.total}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.pmnum.total}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.anum.total}}</text>
					<text>总笔数</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.cash.tnum}}</text>
					<text>现金实收</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.cash.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.cash.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.cash.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.cash.total}}</text>
					<text>总实收</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.mipay.tnum}}</text>
					<text>米券支付</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.mipay.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.mipay.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.mipay.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.mipay.total}}</text>
					<text>总抵扣</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.miextend.tnum}}</text>
					<text>米券发放</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.miextend.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.miextend.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.miextend.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.miextend.total}}</text>
					<text>总发放</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.discount.tnum}}</text>
					<text>门店让利</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.discount.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.discount.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.discount.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.discount.total}}</text>
					<text>总让利</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.singular.tnum}}</text>
					<text>门店单数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.singular.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.singular.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.singular.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.singular.total}}</text>
					<text>总单数</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{fiance.balance.mi}}</text>
					<text>米券余额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.balance.commission}}</text>
					<text>佣金余额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.balance.merch}}</text>
					<text>商家余额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.balance.merchrate}}</text>
					<text>商补余额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{fiance.balance.total}}</text>
					<text>总余额</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【买单销售】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{order.tnum.total}}</text>
					<text>今日单量</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{order.tnum.paymoney}}</text>
					<text>支付额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{order.tnum.order}}</text>
					<text>今日客单</text>
				</view>
				<!-- <view class="d_item">
					<text class="d_num">{{order.tnum.usemoney}}</text>
					<text>消耗额度</text>
				</view> -->
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{order.ynum.total}}</text>
					<text>昨日单量</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{order.ynum.paymoney}}</text>
					<text>支付额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{order.ynum.order}}</text>
					<text>昨日客单</text>
				</view>
				<!-- <view class="d_item">
					<text class="d_num">{{order.ynum.usemoney}}</text>
					<text>消耗额度</text>
				</view> -->
			</view>
			<!-- <view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{order.anum.total}}</text>
					<text>未核销数</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{order.anum.money}}</text>
					<text>未核销额</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{order.usemoney}}</text>
					<text>总卡余额</text>
				</view>
			</view> -->
		</uni-group>
		<uni-group title="【团购销售】" class="d_data" mode="card">
			<view class="d_list flex_between">
				<view class="d_item">
					<text class="d_num">{{groupOrder.tnum.total}}</text>
					<text>今日单量</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.tnum.paymoney}}</text>
					<text>支付额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.trnum.total}}</text>
					<text>退款数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.trnum.paymoney}}</text>
					<text>退款量</text>
				</view>
			</view>
			<view class="d_list flex_between">
				<view class="d_item">
					<text class="d_num">{{groupOrder.ynum.total}}</text>
					<text>昨日单量</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.ynum.paymoney}}</text>
					<text>支付额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.yrnum.total}}</text>
					<text>退款数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{groupOrder.yrnum.paymoney}}</text>
					<text>退款量</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item w24">
					<text class="d_num">{{groupOrder.anum.total}}</text>
					<text>今日核销</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">{{groupOrder.anum.paymoney}}</text>
					<text>核销额</text>
				</view>
				<view class="d_item w24">
					<text class="d_num">0</text>
					<text>到账额</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【提款】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{sendmoney.tnum.money}}</text>
					<text>今日申请</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.tnum.total}}</text>
					<text>申请笔数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.tanum.total}}</text>
					<text>放款中</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.tanum.sendnum}}</text>
					<text>成功放款</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.tanum.refundnum}}</text>
					<text>驳回放款</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{sendmoney.ynum.money}}</text>
					<text>昨日申请</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.yanum.total}}</text>
					<text>申请笔数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.yanum.total}}</text>
					<text>放款中</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.yanum.sendnum}}</text>
					<text>成功放款</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.yanum.refundnum}}</text>
					<text>驳回放款</text>
				</view>
			</view>
			<view class="d_list flex_between">
				<view class="d_item" style="width:20%">
					<text class="d_num">{{sendmoney.anum.total}}</text>
					<text>申请笔数</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.anum.money}}</text>
					<text>总申请额</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.anum.sendmoney}}</text>
					<text>成功放款</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{sendmoney.anum.refundmoney}}</text>
					<text>驳回放款</text>
				</view>
			</view>
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{sendmoney.usemoney}}</text>
					<text>钱包余额</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【本地超市点击量统计】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{clicknums.market.tnum}}</text>
					<text>今日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.market.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.market.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.market.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.market.allnum}}</text>
					<text>总量</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【团购点击量统计】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{clicknums.group.tnum}}</text>
					<text>今日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.group.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.group.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.group.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.group.allnum}}</text>
					<text>总量</text>
				</view>
			</view>
		</uni-group>
		<uni-group title="【商铺点击量统计】" class="d_data" mode="card">
			<view class="d_list">
				<view class="d_item">
					<text class="d_num">{{clicknums.supp.tnum}}</text>
					<text>今日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.supp.ynum}}</text>
					<text>昨日</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.supp.tmnum}}</text>
					<text>本月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.supp.pmnum}}</text>
					<text>上月</text>
				</view>
				<view class="d_item">
					<text class="d_num">{{clicknums.supp.allnum}}</text>
					<text>总量</text>
				</view>
			</view>
		</uni-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shop: [],
				member: [],
				bonusLevel: [],
				fiance: [],
				order: [],
				groupOrder: [],
				sendmoney: [],
				groupGoods: [],
				clicknums: [],
				lineup: [],
				timer: '',
			};
		},
		onLoad() {
			this.getShop();
			this.getMember();
			this.getBonusLevel();
			this.getFiance();
			this.getOrder();
			this.getGroupOrder();
			this.getSendmoney();
			this.getGroupGoods();
			this.getClicknums();
			this.getLineup();
			this.getTime();
		},
		onUnload(){
			clearInterval(this.timeObj)
			this.timeObj = null;
		},
		methods: {
			getTime(){
			   this.timeObj = setInterval(() =>{
				   this.timer = Date.now()} 
				,1000)
			},
			getShop(){
				this.$axios('statistics/shop','POST','member').then(res=>{
					if(res.data.code==200){
						this.shop = res.data.data
					}
				})
			},
			getMember(){
				this.$axios('statistics/member','POST','member').then(res=>{
					if(res.data.code==200){
						this.member = res.data.data
					}
				})
			},
			getBonusLevel(){
				this.$axios('statistics/bonusLevel','POST','member').then(res=>{
					if(res.data.code==200){
						this.bonusLevel = res.data.data
					}
				})
			},
			getFiance(){
				this.$axios('statistics/fiance','POST','member').then(res=>{
					if(res.data.code==200){
						this.fiance = res.data.data
					}
				})
			},
			getOrder(){
				this.$axios('statistics/order','POST','member').then(res=>{
					if(res.data.code==200){
						this.order = res.data.data
					}
				})
			},
			getGroupOrder(){
				this.$axios('statistics/groupOrder','POST','member').then(res=>{
					if(res.data.code==200){
						this.groupOrder = res.data.data
					}
				})
			},
			getSendmoney(){
				this.$axios('statistics/sendmoney','POST','member').then(res=>{
					if(res.data.code==200){
						this.sendmoney = res.data.data
					}
				})
			},
			getGroupGoods(){
				this.$axios('statistics/groupGoods','POST','member').then(res=>{
					if(res.data.code==200){
						this.groupGoods = res.data.data
					}
				})
			},
			getClicknums(){
				this.$axios('statistics/clicknums','POST','member').then(res=>{
					if(res.data.code==200){
						this.clicknums = res.data.data
					}
				})
			},
			getLineup(){
				this.$axios('statistics/lineup','POST','member').then(res=>{
					if(res.data.code==200){
						this.lineup = res.data.data
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.data{
	padding: 80rpx 0 30rpx;
}
.fixed_date{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	line-height: 80rpx;
	text-align: center;
	font-size: 32rpx;
	font-weight: bold;
	color: #333;
	background: #fff;
	box-shadow: 0 2rpx 10rpx 2rpx rgba(200,200,200,.5);
}
.d_data{
	margin-bottom: 15rpx;
}
.d_list{
	display: flex;
	margin-bottom: 15rpx;
	.d_item{
		width: 20%;
		display: flex;
		flex-direction: column;
		align-items: center;
		.d_num{
			color:$bg-color;
			font-weight: bold;
		}
	}
}
.flex_between{
	justify-content: space-between;
	.d_item{
		width: 25%;
	}
}
.w24{
	width: 25%!important;
}
</style>
